package map;

import java.util.HashMap;
import java.util.Map;

public class Test1 {
    public static void main(String[] args) {

        Map<Integer,String> map = new HashMap<>();
        map.put(1,"三团");// 放入元素
        map.put(2,"小小胖三团");// 放入元素
        map.put(2,"三胖胖");// 放入元素覆盖同 key值的
        System.out.println(map.get(2));// 根据key获取元素的value
        String defalt = map.getOrDefault(3, "哈哈哈");// 找不到则返回默认的 "哈哈哈"
        System.out.println(defalt);
        boolean b = map.containsKey(2);// 是否包含key值为2的元素
        System.out.println(map);
        System.out.println("===================");

        Integer[] ints = new Integer[10];
        System.out.println(ints.getClass());
        Object[] o = (Object[]) ints;
        System.out.println(o.getClass());
        System.out.println("==============");

        Integer a = 10;
        System.out.println(a.getClass());
        Object o1 = (Object)a;
        System.out.println(o1.getClass());
    }
}
